﻿CREATE TABLE [dbo].[ExBugSetup] (
    [PrimaryKey]                 INT             CONSTRAINT [DF_ExBugSetup_PrimaryKey] DEFAULT ((0)) NOT NULL,
    [CodUnitate]                 SMALLINT        CONSTRAINT [DF_ExBugSetup_CodUnitate] DEFAULT ((0)) NOT NULL,
    [CompartimentSpecialitate]   VARCHAR (50)    CONSTRAINT [DF_ExBugSetup_CompartimentSpecialitate] DEFAULT ('') NOT NULL,
    [OrdonatorCredite]           VARCHAR (50)    CONSTRAINT [DF_ExBugSetup_OrdonatorCredite] DEFAULT ('') NOT NULL,
    [AnulCurent]                 SMALLINT        CONSTRAINT [DF_ExBugSetup_AnCurent] DEFAULT ((2000)) NOT NULL,
    [LunaCurenta]                SMALLINT        CONSTRAINT [DF_ExBugSetup_LunaCurenta] DEFAULT ((1)) NOT NULL,
    [FolosesteDenumireBuget]     BIT             CONSTRAINT [DF_ExBugSetup_FolosesteDenumireBuget] DEFAULT ((0)) NOT NULL,
    [IDSeriePAC]                 NVARCHAR (20)   CONSTRAINT [DF_ExBugSetup_IDSeriePAC] DEFAULT ('') NULL,
    [IDSerieAB]                  NVARCHAR (20)   CONSTRAINT [DF_ExBugSetup_IDSerieAB] DEFAULT ('') NULL,
    [IDSerieAL]                  NVARCHAR (20)   CONSTRAINT [DF_ExBugSetup_IDSerieAL] DEFAULT ('') NULL,
    [IDSerieOLP]                 NVARCHAR (20)   CONSTRAINT [DF_ExBugSetup_IDSerieOLP] DEFAULT ('') NULL,
    [IDSerieCFP]                 NVARCHAR (20)   CONSTRAINT [DF_ExBugSetup_IDSerieCFP] DEFAULT ('') NULL,
    [ContBA]                     [dbo].[TipCont] CONSTRAINT [DF_ExBugSetup_ContBA] DEFAULT ('') NULL,
    [ContAB]                     [dbo].[TipCont] CONSTRAINT [DF_ExBugSetup_ContAB] DEFAULT ('') NULL,
    [ContAL]                     [dbo].[TipCont] CONSTRAINT [DF_ExBugSetup_ContAL] DEFAULT ('') NULL,
    [ContCD]                     [dbo].[TipCont] CONSTRAINT [DF_ExBugSetup_ContCD] DEFAULT ('') NULL,
    [CaleOPFV]                   VARCHAR (250)   NULL,
    [TiparesteContPeOrdonantare] BIT             CONSTRAINT [DF_ExBugSetup_TiparesteContPeOrdonantare] DEFAULT ((0)) NULL,
    [StergePACABGenerat]         BIT             DEFAULT ((1)) NOT NULL,
    [ColoanaDepartamente]        BIT             DEFAULT ((1)) NOT NULL,
    [AfiseazaParteneriFolositi]  BIT             DEFAULT ((0)) NULL,
    [ContO]                      [dbo].[TipCont] NULL,
    [GenereazaNCOrdonantare]     BIT             DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_ExBugSetup] PRIMARY KEY CLUSTERED ([PrimaryKey] ASC, [CodUnitate] ASC),
    CONSTRAINT [FK_ExBugSetup_Conturi] FOREIGN KEY ([ContO], [CodUnitate]) REFERENCES [dbo].[Conturi] ([Cont], [CodUnitate])
);

